<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<h:body>
	<h:panelGrid columns="3" id="newOrderPanel">
		<f:facet name="header">  
          New Order
        </f:facet>

		<h:outputLabel value="Name*:  " />
		<p:inputText id="order_name_str" required="true" label="Name*: "
			value="#{ordersBean.newOrder.bookName}" />
		<p:message for="order_name_str" display="text" />

		<h:outputLabel value="Book's URL:  " />
		<p:inputText id="order_url_str" label="URL: "
			value="#{ordersBean.newOrder.bookUrl}" />
		<p:message for="order_url_str" display="text" />

		<h:outputLabel value="Shop:  " />
		<p:selectOneMenu required="true"  id="order_notes_str"
			value="#{ordersBean.newOrder.shops.name}">
			<f:selectItem itemLabel="Select Shop" itemValue="" />
			<f:selectItems value="#{ordersBean.shopslist}" var="shop" itemLabel="#{shop.name}" itemValue="#{shop.name}"/>
		</p:selectOneMenu>
		<p:message for="order_notes_str" display="text" />

		<h:outputLabel value="Notes:  " />
		<p:inputTextarea id="desc" rows="5" cols="50" counter="counter"
			maxlength="512" counterTemplate="{0} characters remaining."
			autoResize="false" value="#{ordersBean.newOrder.notes}" />
		<p:message for="desc" display="text" />
		<h:outputLabel value="  " />
		<h:outputText id="counter" />

		<f:facet name="footer">
			<p:commandButton value="Save" update="newOrderPanel"
				action="#{ordersBean.saveNewOrder}" />
			<p:commandButton value="Cancel" action="#{ordersBean.hideDialog}"
				immediate="true" />
		</f:facet>

	</h:panelGrid>
</h:body>
</html>